package com.zizy.healthexpert.Database;


import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;
/*
* you'd first create a variable named "tableName"
* and then implement the methods
*
*
*
* */
abstract public class MyDataBase {
	protected SQLiteDatabase db;//the order is  name, type,longtitude,latitude

	MyDataBase(Context context) {
		MyDataBase.DataBase myDataBaseHelper = new MyDataBase.DataBase(context);
		this.db = myDataBaseHelper.getWritableDatabase();
		initMyDatabase();

	}

	// init database
	public abstract void initMyDatabase();
	public abstract ArrayList<Object> SearchDatabase(String selectWhat, String where_expression);
	public abstract ArrayList<Object> SearchDatabase(String selectWhat);
	public abstract void insertDatabase(Object...objects);
	public abstract void updateDatabase(Object...objects);
	public abstract void CreateTable();
	
	public void close(){
		db.close();
	}
	
	public class DataBase extends DatabaseHelper {
		public DataBase(Context context) {
			super(context);

			// TODO Auto-generated constructor stub
		}

	}
}